package com.zhengxiang.onlinexamination.controller;


import com.baomidou.mybatisplus.extension.api.ApiController;

import com.zhengxiang.onlinexamination.base.AjaxResult;
import com.zhengxiang.onlinexamination.entity.vo.QuBankVo;
import com.zhengxiang.onlinexamination.service.QuBankService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 题库(ZQuBank)表控制层
 *
 * @author 
 * @since 2023-03-10 10:56:10
 */
@RestController
@RequestMapping("quBank")
public class QuBankController extends ApiController {
    /**
     * 服务对象
     */
    @Resource
    private QuBankService quBankService;

    /**
     * 获取题库下拉框
     * @param quBankVo
     * @return
     */
    @PostMapping("/queryAll")
    public AjaxResult queryAll(@RequestBody QuBankVo quBankVo){
        return AjaxResult.success(quBankService.queryAll(quBankVo));
    }



    /**
     * 题库列表
     * @param quBankVo
     * @return
     */
    @GetMapping("/queryQuBankAll")
    public AjaxResult queryQuBankAll(QuBankVo quBankVo){
        return AjaxResult.success(quBankService.queryQuBankAll(quBankVo));
    }

    /**
     * 新增题库
     * @param quBankVo
     * @return
     */
    @PostMapping("/saveQuBank")
    public AjaxResult saveQuBank(@RequestBody QuBankVo quBankVo){
        quBankService.saveQuBank(quBankVo);
        return AjaxResult.success();
    }

    /**
     * 删除题库
     * @return
     */
    @PostMapping("/delQuBank")
    public AjaxResult delQuBank(@RequestBody QuBankVo quBankVo){
        quBankService.delQuBank(quBankVo);
        return AjaxResult.success();
    }


    /**
     * 题库详情
     * */
    @GetMapping("/queryBankDetail")
    public AjaxResult queryBankDetail(QuBankVo quBankVo){

        return AjaxResult.success(quBankService.queryBankDetail(quBankVo));
    }
}

